package ua.com.globallogic.basecamp.krasnyanskiy.webcrawler;

import java.io.IOException;

public class SimpleCrawlerApplication {
    public static void main(String... args) throws IOException {

        System.out.println("Building pages...");
        URLValidator val = new URLValidator(args);

        if (val.validate()) {
            Crawler crawler = new Crawler();

            int depth = Integer.parseInt(args[1]);
            String url = args[0];

            crawler.download(url, depth);
            System.out.println("Building is complete");
        } else {
            System.out.println("Please check the input URL and depth!");
        }
    }
}
